<?php 
	namespace Home\Model;
	use Think\Model;
	class UserModel extends Model
	{
		//自动完成
		protected $_auto = array ( 
		    array('userpass','md5',3,'function'),  
		);

		//自动验证
		protected $_validate = array(
				//array(验证字段1,验证规则,错误提示,[验证条件,附加规则,验证时间]),
				array('phone','require','手机号不能为空!!!'),
				array('phone','/^1[35478]\d{9}/','手机号不符合,请重新输入!!!',0,'regex'),
				array('userpass','require','密码不能为空!!!',1,''),
				// 验证确认密码是否和密码一致
				array('repassword','userpass','确认密码不正确',1,'confirm'), 
				array('userpass','/^\w{6,12}$/','密码必须是6-12位的shuzi、字母、下划线',0,'regex'), 
			  	array('phone','','手机号已经被注册,请重新输入！',2,'unique',1), 
			  	array('email','email','邮箱格式不正确')


			);
	}